package com.beyond.trace.dy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.beyond.trace.dy.mapper.TraceDyFarmersMapper;
import com.beyond.trace.dy.domain.TraceDyFarmers;
import com.beyond.trace.dy.service.ITraceDyFarmersService;

/**
 * 养殖户管理Service业务层处理
 * 
 * @author Mr.Yao
 * @date 2022-04-08
 */
@Service
public class TraceDyFarmersServiceImpl extends ServiceImpl<TraceDyFarmersMapper, TraceDyFarmers> implements ITraceDyFarmersService
{
    @Resource
    private TraceDyFarmersMapper traceDyFarmersMapper;

    /**
     * 查询养殖户管理
     * 
     * @param farmersId 养殖户管理ID
     * @return 养殖户管理
     */
    @Override
    public TraceDyFarmers selectTraceDyFarmersById(Long farmersId)
    {
        return traceDyFarmersMapper.selectTraceDyFarmersById(farmersId);
    }

    /**
     * 查询养殖户管理列表
     * 
     * @param traceDyFarmers 养殖户管理
     * @return 养殖户管理
     */
    @Override
    public List<TraceDyFarmers> selectTraceDyFarmersList(TraceDyFarmers traceDyFarmers)
    {
        return traceDyFarmersMapper.selectTraceDyFarmersList(traceDyFarmers);
    }

    /**
     * 新增养殖户管理
     * 
     * @param traceDyFarmers 养殖户管理
     * @return 结果
     */
    @Override
    public boolean insertTraceDyFarmers(TraceDyFarmers traceDyFarmers)
    {
        traceDyFarmers.setCreateTime(DateUtils.getNowDate());
        //return traceDyFarmersMapper.insertTraceDyFarmers(traceDyFarmers);
        return super.save(traceDyFarmers);
    }

    /**
     * 修改养殖户管理
     * 
     * @param traceDyFarmers 养殖户管理
     * @return 结果
     */
    @Override
    public int updateTraceDyFarmers(TraceDyFarmers traceDyFarmers)
    {
        traceDyFarmers.setUpdateTime(DateUtils.getNowDate());
        return traceDyFarmersMapper.updateTraceDyFarmers(traceDyFarmers);
    }

    /**
     * 批量删除养殖户管理
     * 
     * @param farmersIds 需要删除的养殖户管理ID
     * @return 结果
     */
    @Override
    public int deleteTraceDyFarmersByIds(Long[] farmersIds)
    {
        return traceDyFarmersMapper.deleteTraceDyFarmersByIds(farmersIds);
    }

    /**
     * 删除养殖户管理信息
     * 
     * @param farmersId 养殖户管理ID
     * @return 结果
     */
    @Override
    public int deleteTraceDyFarmersById(Long farmersId)
    {
        return traceDyFarmersMapper.deleteTraceDyFarmersById(farmersId);
    }
}
